package bishi.day12_5_7;

import java.util.Scanner;

/**
 * 最接近偶数的两个素数
 * @author 是阿秋啊
 * @date 2022/05/07 16:41
 **/
public class twoPrime {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            int even = sc.nextInt();
            int min = even / 2;
            int max = even / 2;
            while(min > 0 && max < even) {
                while(!isPrime(min)) {
                    min--;
                }
                while(!isPrime(max)) {
                    max++;
                }
                if(max + min == even) {
                    break;
                }else if(max + min > even) {
                    min--;
                }else {
                    max++;
                }
            }
            System.out.println(min + "\n" + max);
        }
    }
    public static boolean isPrime(int n) {
        for(int i = 2; i < n / 2; i++) {
            if(n % i == 0) {
                return false;
            }
        }
        return true;
    }
}